#ifndef MORPH_H
#define MORPH_H


#include <vector>
#include <iostream>
#include <Segment.h>
#include <Imagen.h>
#include <utiles.h>

#include <ImagenRGB.h>

#include <stdio.h>
#include <iostream>
#include <sstream>
#include <stdlib.h>

typedef std::vector<Segment> Segments;


class Morph
	{
	 public:
		Segments ImASegments;
		Segments ImBSegments;

		ImagenRGB ImA;
		ImagenRGB ImB;

    //cosntructor
	//Morph();
	void initialitze(ImagenRGB ImagenA, ImagenRGB ImagenB, Segments &ASegments, Segments &BSegments);

	//Methods
	void generateMorph(int num_images, char * OutImageFilename);

	void generateImage(int step, int num_images,char * OutImageFilename);
	Segments intermediateSegments (int step, int num_images);
    Point calculateUV(Point actual_point, Segment segmentDest);
	Point calculateX(Point pointUV, Segment segmentSrc);
	double calculateMinDistance(Point pointUV, Point actual_point, Segment segmentSrc);
	double calculaWeight(Segment segment,double distance);
	double module(Point p, Point q);
	Point getXPrimaFinal(Point actual_point, Segments & tmp_segments, Segments & segmentsSrc);


	};



#endif
